package com.syedu.day06.v1;

import java.time.LocalDate;

/**
 * description：测试类
 * @author Administrator
 * @date 2022/3/15 13:36
 */
public class TestEmployee {
    public static void main(String[] args) {
        //创建三个不同的员工对象
        Employee e1 = new Employee();
        //设置属性值
        e1.name = "BB";
        e1.age = 21;
        e1.hireDate = LocalDate.of(2002, 12, 12);
        e1.salary = 10000.0;

        Employee e2 = new Employee();
        e2.name = "AA";
        e2.age = 24;
        e2.hireDate = LocalDate.of(2012, 6, 20);
        e2.salary = 10000.0;

        Employee e3 = new Employee();
        e3.name = "CC";
        e3.age = 22;
        e3.hireDate = LocalDate.of(2020, 8, 1);
        e3.salary = 10000.0;

        //把员工添加到数组中
        Employee[] employees = {e1, e2, e3};

        //遍历数组
        for (Employee e : employees) {
            System.out.println(e.name + "," + e.age + "," + e.hireDate + "," + e.salary);
            e.work();
        }
    }
}